#include <iostream>  
#include <string>  
using namespace std;  
class Person {  
protected:  
    int ID;  
    string Name;  
public:  
    Person(int id, string name) : ID(id), Name(name) {}    
    void input() {  
        cout << "请输入编号: ";  
        cin >> ID;  
        cout << "请输入姓名: ";  
        cin >> Name;  
    }  
    void display() const {  
        cout << "编号: " << ID << ", 姓名: " << Name << endl;  
    }  
};   
class Student : public Person {  
private:  
    string Class;  
    double Grade;  
public:   
    Student() :{}
    Student(int id, string name, string cls, double grd) : Person(id, name), Class(cls), Grade(grd) {}   
    void input() {  
        Person::input(); 
        cout << "请输入班级: ";  
        cin >> Class;  
        cout << "请输入成绩: ";  
        cin >> Grade;  
    }   
    void display() const {  
        Person::display();
        cout << "班级: " << Class << ", 成绩: " << Grade << endl;  
    }  
};  
class Teacher : public Person {  
private:  
    string Title;  
    string Department;  
public:  
    Teacher(int id, string name, string ttl, string dept) : Person(id, name), Title(ttl), Department(dept) {}   
    void input() {  
        Person::input();
        cout << "请输入职称: ";  
        cin >> Title;  
        cout << "请输入部门: ";  
        cin >> Department;  
    }   
    void display() const {  
        Person::display();
        cout << "职称: " << Title << ", 部门: " << Department << endl;  
    }  
};  
int main() {   
    Student student;  
    cout << "请输入学生数据:" << endl;  
    student.input();  
    Teacher teacher;  
    cout << "请输入教师数据:" << endl;  
    teacher.input();   
    cout << "学生信息:" << endl;  
    student.display();  
    cout << "教师信息:" << endl;  
    teacher.display();  
    return 0;  
}